<%@ Page Language="C#" AutoEventWireup="true" Codebehind="Grant.aspx.cs" MasterPageFile="~/Frame.Master"
    Inherits="BaseSystem._System.Grant" %>

<%@ Import Namespace="Auto.Data.HumanResource" %>
<%@ Import Namespace="Auto.Data.Security" %>
<%@ Register Src="UserControl/ucDivision.ascx" TagName="ucDivision" TagPrefix="uc2" %>
<%@ Register Src="UserControl/ucGranttree.ascx" TagName="ucGranttree" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentMain" runat="server">

    <script src="../_System/Script/Common.js" type="text/javascript"></script>

    <div>
        <div class="TitleDivStyle">
            <asp:Label ID="Label1" runat="server" Text="<%$Resources:Base,Grant %>" CssClass="TitleStyle"></asp:Label></div>
        <table cellpadding="0" cellspacing="0" border="0">
            <tr>
                <td nowrap="nowrap" style="width: 560px;" valign="top" class="borderStyle">
                    <table>
                        <tr>
                            <td>
                                <div class="OperateStyle">
                                    <%=Resources.Base.LoginUserID%>
                                    <asp:TextBox ID="txtUserID" runat="server" Width="75px"></asp:TextBox>
                                    <%=Resources.Base.Division%>
                                    <uc2:ucDivision ID="UcDivision1" runat="server" />
                                    <asp:Button ID="btnSearch" runat="server" Text="<%$Resources:Base,Search %>" OnClick="btnSearch_Click"
                                        CssClass="button_bak" />
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <div style="border: 1px solid #218afb; background-color: #cfdbec;">
                                    <div style="border: 1px solid #218afb; margin: 2px; padding: 2px;">
                                        <asp:DropDownList ID="ddlSystems" runat="server">
                                        </asp:DropDownList></div>
                                    <div style="z-index: 101; width: 100%;" class="overStyle">
                                        <asp:GridView ID="GVUsers" runat="server" AutoGenerateColumns="False" OnRowCommand="GVUsers_RowCommand"
                                            CssClass="mainView" AllowSorting="True" OnSorting="GVUsers_Sorting" Width="556px">
                                            <FooterStyle CssClass="GridViewFooterStyle" />
                                            <Columns>
                                                <asp:TemplateField HeaderText="<%$ Resources:Base,DivID %>" SortExpression="DivID">
                                                    <ItemTemplate>
                                                        <%# DataBinder.Eval(Container.DataItem, Division.FIELD_DivID).ToString() %>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="<%$ Resources:Base,DivName %>" SortExpression="DivName">
                                                    <ItemTemplate>
                                                        <%# DataBinder.Eval(Container.DataItem, Division.FIELD_DivName).ToString() %>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="<%$ Resources:Base,UserName %>" SortExpression="UserName">
                                                    <ItemTemplate>
                                                        <%# DataBinder.Eval(Container.DataItem,Users.FIELD_UserName).ToString() %>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="<%$ Resources:Base,UserID %>" SortExpression="UserID">
                                                    <ItemTemplate>
                                                        <%# DataBinder.Eval(Container.DataItem,Users.FIELD_UserID).ToString() %>
                                                        <asp:Label ID="lblUserID" runat="server" Text='<%# DataBinder.Eval( Container.DataItem,Users.FIELD_UserID) %>'
                                                            Visible="false"></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField ShowHeader="False">
                                                    <ItemStyle Wrap="False" />
                                                    <ItemTemplate>
                                                        <asp:LinkButton ID="LinkButton1" runat="server" CommandArgument="<%# Container.DisplayIndex %>"
                                                            CommandName="SetRoles"><%=Resources.Base.GrantSet%></asp:LinkButton>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                            </Columns>
                                            <RowStyle CssClass="GridViewRowStyle" />
                                            <EditRowStyle CssClass="GridViewEditRowStyle" />
                                            <SelectedRowStyle CssClass="GridViewSelectedRowStyle" />
                                            <PagerStyle CssClass="GridViewPagerStyle" />
                                            <HeaderStyle CssClass="GridViewHeaderStyle" />
                                            <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                                        </asp:GridView>
                                    </div>
                                </div>
                            </td>
                        </tr>
                    </table>
                </td>
                <td nowrap="nowrap" id="tbRoles" runat="server" visible="false" valign="top">
                    <table width="300px" class="borderStyle">
                        <tr>
                            <td align="left" nowrap="nowrap" class="cellborderStyle">
                                <%=Resources.Base.UserName%>
                                <asp:Label ID="lblUserName" runat="server" Font-Underline="True"></asp:Label>,
                                <%=Resources.Base.SetRoleNote%>
                            </td>
                        </tr>
                        <tr>
                            <td nowrap="nowrap" class="cellborderStyle" style="background-color: #edf1f8;">
                                <div id="ucGranttree1Div" style="z-index: 101; width: 100%;" class="overStyle">
                                    <uc1:ucGranttree ID="ucGranttree1" runat="server" />
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td align="center" class="cellborderStyle">
                                <asp:LinkButton ID="lkbtnOK" runat="server" OnClick="lkbtnOK_Click" Text="<%$Resources:Base,OK %>"></asp:LinkButton>&nbsp;
                                <asp:LinkButton ID="lkbtnCancel" runat="server" OnClick="lkbtnCancel_Click" Text="<%$Resources:Base,Cancel %>"></asp:LinkButton></td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </div>

    <script type="text/javascript">
//    function adjustSize()
//    {
//        var setheight=document.documentElement.offsetHeight-96;
//        if(setheight>0)
//        {
//            var ucgranttreediv=document.getElementById("ucGranttree1Div");
//            if(ucgranttreediv!=null)
//            {
//                ucgranttreediv.style.height=setheight+"px";
//            }
//        }
//         
//    }

//    window.onload=function()
//    {
//        adjustSize();
//    }
//    window.onresize=function()
//    {
//        adjustSize();
//    }
    
        window.onload=function()
        {
            setHeight("ucGranttree1Div",-96);
        }
        window.onresize=function()
        {
            setHeight("ucGranttree1Div",-96);
        }

    </script>

</asp:Content>
